package com.zline.foodraise.adapter;

import android.content.Context;
import android.net.Uri;
import android.view.ViewGroup;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.zline.foodraise.R;
import com.zline.foodraise.util.ImageUtil;
import com.zline.foodraise.view.CommentListItemPicsItem;
import com.zline.foodraise.view.CommentListItemPicsItem_;
import com.zline.foodraise.view.ReleaseDynamicPicItem;

import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;

import java.util.Map;

/**
 * Created by heshantao on 15/8/1.
 * 评论列表中图片列表
 */
@EBean
public class CommentListItemPicsAdapter extends RecyclerViewBaseAdapter<String, CommentListItemPicsItem> {
    private static final String LOG_TAG = CommentListItemPicsAdapter.class.getSimpleName();
    @RootContext
    Context cxt;
    @Bean
    ImageUtil imageUtil;
    DisplayImageOptions options;

    @Override
    protected CommentListItemPicsItem onCreateItemView(ViewGroup parent, int viewType) {
        return CommentListItemPicsItem_.build(cxt);
    }

    @Override
    public void onBindViewHolder(ViewWrapper<CommentListItemPicsItem> holder, int position) {
        CommentListItemPicsItem view = holder.getView();
        String url = arrys.get(position);
        view.setListener(itemClicked);
        if (options == null) {
            options = imageUtil.
                    getDisplayImageOptions(R.mipmap.default_product_icon,
                            R.mipmap.default_product_icon, R.mipmap.default_product_icon);
        }
        view.bind(flag, url, position, parentPosition, options);

    }


}
